Product : VxWorks target

Date    : 18-January-1999

File    : Global.More info on DEF_NO_GLOBAL on VxWorks.htm

Subject : More info on DEF_NO_GLOBAL on VxWorks

Keywords: DEF_NO_GLOBAL - Global variables on VxWorks

____________________________________________________________________

Reserved for persons with the IDK

 

DEF_NO_GLOBAL has been implemented in the scope of VxWorks

implementation of the target.

On this system, all threads share the same location for global

variables.

This explains why you find tasy0gbl.h in VxWorks sources only.

The implementation does not consist in changing body of functions

without using globals.

The implementation consists in removing globals declaration and

instanciating them for each task incarnation.

Then the minimum requirement is to be able to specify that at least

several specific global variables (in our case pointers) have

different value (in our case the location of allocated memory)

according to the task incarnation.

This is generally done by the system scheduler facility

(taskVarAdd for VXWORKS) which save/retrieve the value according to

the task to execute at each context switch.

Of course there are only a few (2 or 3) of these variables.

Then any global variable name is defined as the corresponding field

pointed to by the task global pointer (see tasy0gbl.h).

 

More over there are some specific calls to allocate and initialize

structures of global data.

 

In VxWorks implementation, most of all globals are replaced,

for the kernel and for the communication task.

You can explore tasy0gbl.h file to see how globals have been

packed together.

There is:

a structure (str_ker_globals) for the kernel itself

a structure (str_common_globals) for all tasks, including the kernel

task. It mainly groups in fact data for the communicayion layer (lvx)

and the system layer.

a structure (str_srv_globals) for the asynchronous server clients

____________________________________________________________________

Copyright © 1996-2009 ICS Triplex ISaGRAF Inc. All rights reserved.